<%@ include file="/WEB-INF/jsp/include.jsp" %>

<html>
<head><title>Your Employee(Spring 3 XML free)</title></head>
<body>
<h1><security:authentication property="principal.username"/>'s Employees</h1>
<P>
<c:forEach var="employer" items="${model.employers}" >
<P><P>
<h2><c:out value="${employer.id}" /> <c:out value="${employer.name}" /> <a href="<c:url value="deleteEmployer.htm?id="/><c:out value="${employer.id}" />">Delete</a></h2>

<table cellpadding=3 border=1>
<tr><td><b>id</b></td><td><b>First Name</b></td><td><b>Last Name</b></td><td><b>Email</b></td><td><b>Benefits</b></td></tr>
  <c:forEach items="${employer.employees}" var="e">
    <tr>
        <td><c:out value="${e.id}" /></td>
        <td><c:out value="${e.firstName}" /></td>
        <td><c:out value="${e.lastName}" /></td>
        <td><c:out value="${e.email}" /></td>
        <td>
            <ul>
               <c:forEach items="${e.benefits}" var="b">
                   <li><c:out value="${b.id}" /> - <c:out value="${b.value}" /></li>
               </c:forEach>
            </ul>
        </td>
    </tr>     
  </c:forEach>
</table>
</c:forEach>

<p><a href="<c:url value="addEmployer.htm"/>">Add</a>   <p><a href="<c:url value="../j_spring_security_logout"/>">Logoff</a> (also clears any remember-me cookie)
</body>
</html>
